import { Component } from "react";
import Son1 from "./son1";
import Son2 from "./son2";
import { globalContext, globalData,globalAction } from './global'
const {Provider} = globalContext



class Parent extends Component{
    state={
        ...globalData,
        ...globalAction(this)
    } 
   
    render() {
        return (
             <div>
                <Provider value={this.state}>
                <h2>子组件1</h2>
                    <Son1></Son1>
                    <h2>子组件2</h2>
                    <Son2 footer={<div>footer区域</div>}>父组件传来的匿名插槽==</Son2>
                    
                    
                </Provider>
             </div>
        );
    }
}
export default Parent